package com.mingqi.enetconnected.view;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;

import com.mingqi.enetconnected.R;
import com.mingqi.enetconnected.util.resource.ResourceUtils;

/**
 * Created by li on 2018/8/23.
 * WeChat 18571658038
 * author LiWei
 */

public class LeftEditText extends android.support.v7.widget.AppCompatEditText {

    public LeftEditText(Context context, AttributeSet attrs) {
        super(context, attrs);

        //左 上 右 下
        Drawable drawable = getCompoundDrawables()[0];

        //设置drawable 的位置属性     left top 代表drawable的位置（坐标）  距离左边和上方的距离
        //right  bottom 相当于宽和高

        int widthDimen = ResourceUtils.getDimen(R.dimen.x15);
        int heightDimen = ResourceUtils.getDimen(R.dimen.y15);
        drawable.setBounds(0, 0, widthDimen, heightDimen);
        setCompoundDrawables(drawable, null, null, null);
    }
}
